package cn.s1995.sloth.app.api.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
 * ForgetPasswordDTO
 *
 * @author Lex
 * @description
 * @date 2024/01/15 18:17
 */
@Data
@Schema(description = "忘记密码")
@AllArgsConstructor
@NoArgsConstructor
public class ForgetPasswordDTO implements Serializable {
    /**
     * 密码
     * 6-16位数字+字母或符号
     */
    public static final String PASSWORD = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z+&@#/%?=~_|!:,.;]{6,20}$";


    /**
     * 用户名
     */
    @NotNull
    @Schema(description = "用户名")
    private String username;

    /**
     * 密码
     */
    @NotNull
    @Pattern(regexp = PASSWORD, message = "请输入正确格式的密码：6-16位数字+字母或符号")
    @Schema(description = "密码")
    private String password;

    /**
     * 新密码
     */
    @NotNull
    @Pattern(regexp = PASSWORD, message = "请输入正确格式的密码：6-16位数字+字母或符号")
    @Schema(description = "新密码")
    private String newpassword1;
}
